home *** CD-ROM | disk | FTP | other *** search
/ Aminet 2 / Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso / Aminet / misc / amag / am9305b.lha / EGS / Listing.c next >
C/C++ Source or Header  |  1993-03-22  |  2KB  |  65 lines

  1. /* EGS_Test.c
  2.  *
  3.  */
  4. #include <exec/types.h>
  5. #include <proto/exec.h>
  6. #include <egs/egsintui.h>
  7. #include <egs/proto/egsintui.h>
  8. #include <egs/egsgfx.h>
  9. #include <egs/proto/egsgfx.h>
  10.  
  11. struct Library *EGSIntuiBase;
  12. struct Library *EGSGfxBase;
  13.  
  14. int   i;
  15. ULONG color, ocolor;
  16.  
  17. void main( int argc, char **argv )
  18. {
  19.   static struct EI_NewWindow newWindow = {
  20.     100,50, 400,200,
  21.     0,0, 0,0,
  22.     NULL,
  23.     EI_WINDOWCLOSE | EI_WINDOWBACK | EI_WINDOWDRAG,
  24.     NULL,
  25.     "EGS-Fenster",
  26.     EI_GIMMEZEROZERO | EI_SMART_REFRESH,
  27.     EI_iCLOSEWINDOW,
  28.     NULL,
  29.     {0,0,0,0,0,0,0},
  30.     NULL,
  31.     NULL
  32.     };
  33.   EI_WindowPtr window;
  34.  
  35.   EGSIntuiBase=OpenLibrary("egsintui.library",0);
  36.   if( EGSIntuiBase ) {
  37.     EGSGfxBase = OpenLibrary("egsgfx.library",0);
  38.     if( EGSGfxBase ) {
  39.       window = EI_OpenWindow( &newWindow );
  40.       if( window ) {
  41.         ocolor = EI_ObtainColor( window->WScreen,
  42.                                0xff, 0x00, 0x00);
  43.         for(i=2;i<398;i+=4) {
  44.           color = (((ULONG)i*3 & 0xff) << 24) |
  45.                   (((ULONG)i*2 & 0xff) << 16) |
  46.                   (((ULONG)i   & 0xff) << 8);
  47.           EG_SetAPen( window->RPort,color);
  48.           EG_RectFill( window->RPort,i,2,4,196);
  49.         }
  50.         EG_SetAPen( window->RPort, ocolor);
  51.         EG_Move( window->RPort, 1, 1);
  52.         EG_Draw( window->RPort, 398, 1);
  53.         EG_Draw( window->RPort, 398, 198);
  54.         EG_Draw( window->RPort, 1, 198);
  55.         EG_Draw( window->RPort, 1, 1);
  56.         WaitPort( window -> UserPort );
  57.         EI_ReleaseColor( window->WScreen, ocolor);
  58.         EI_CloseWindow( window );
  59.       }
  60.       CloseLibrary( EGSGfxBase );
  61.     }
  62.     CloseLibrary( EGSIntuiBase );
  63.   }
  64. }
  65.